Skip to content

Conversation

@vkuzo
Copy link
Contributor

@vkuzo vkuzo commented Nov 3, 2025

Summary:

Change the granularity for this scaling type from
PerBlock((1, 128)), PerBlock((128, 128)) to PerBlock([1, 128]), PerBlock([128, 128]),
to get around the current limitation of config serialization not
supporting tuples.

Error when serializing tuples:
https://gist.github.com/vkuzo/ab4d6aec83cb98ad9417898d2c024a2c

Supporting tuples and lists would be a better long term fix, but the
workaround will unblock further work in the short term.

Test Plan:

pytest test/quantization/quantize_/workflows/float8/test_float8_tensor.py -s -x

Reviewers:

Subscribers:

Tasks:

Tags:

vkuzo added 30 commits October 29, 2025 04:05
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
vkuzo added 3 commits October 31, 2025 12:44
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
@vkuzo
Copy link
Contributor Author

vkuzo commented Nov 3, 2025

Stack from ghstack (oldest at bottom):

@pytorch-bot
Copy link

pytorch-bot bot commented Nov 3, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/3279

Note: Links to docs will display an error until the docs builds have been completed.

This comment was automatically generated by Dr. CI and updates every 15 minutes.

vkuzo added a commit that referenced this pull request Nov 3, 2025
Summary:

Change the granularity for this scaling type from
`PerBlock((1, 128)), PerBlock((128, 128))` to `PerBlock([1, 128]), PerBlock([128, 128])`,
to get around the current limitation of config serialization not
supporting tuples.

Error when serializing tuples:
https://gist.github.com/vkuzo/ab4d6aec83cb98ad9417898d2c024a2c

Supporting tuples and lists would be a better long term fix, but the
workaround will unblock further work in the short term.

Test Plan:

```
pytest test/quantization/quantize_/workflows/float8/test_float8_tensor.py -s -x
```

Reviewers:

Subscribers:

Tasks:

Tags:
ghstack-source-id: e150e2a
ghstack-comment-id: 3480842282
Pull-Request: #3279
@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 3, 2025
@vkuzo vkuzo added the topic: improvement Use this tag if this PR is an improvement (doesn't fit into any of the other categories) label Nov 3, 2025
vkuzo added 2 commits November 3, 2025 12:42
[ghstack-poisoned]
[ghstack-poisoned]
vkuzo added a commit that referenced this pull request Nov 3, 2025
Summary:

Change the granularity for this scaling type from
`PerBlock((1, 128)), PerBlock((128, 128))` to `PerBlock([1, 128]), PerBlock([128, 128])`,
to get around the current limitation of config serialization not
supporting tuples.

Error when serializing tuples:
https://gist.github.com/vkuzo/ab4d6aec83cb98ad9417898d2c024a2c

Supporting tuples and lists would be a better long term fix, but the
workaround will unblock further work in the short term.

Test Plan:

```
pytest test/quantization/quantize_/workflows/float8/test_float8_tensor.py -s -x
```

Reviewers:

Subscribers:

Tasks:

Tags:
ghstack-source-id: 68799cc
ghstack-comment-id: 3480842282
Pull-Request: #3279
KernelPreference.AUTO,
KernelPreference.TORCH,
), "unimplemented"
assert self.mm_config is None, "unimplemented"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this supported now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, this is tested with the serialization flow. When the object is created a default value of mm_config is set, and then when object is saved and reloaded, that value then makes it to the constructor.

vkuzo added 2 commits November 6, 2025 03:52
[ghstack-poisoned]
[ghstack-poisoned]
vkuzo added a commit that referenced this pull request Nov 6, 2025
Summary:

Change the granularity for this scaling type from
`PerBlock((1, 128)), PerBlock((128, 128))` to `PerBlock([1, 128]), PerBlock([128, 128])`,
to get around the current limitation of config serialization not
supporting tuples.

Error when serializing tuples:
https://gist.github.com/vkuzo/ab4d6aec83cb98ad9417898d2c024a2c

Supporting tuples and lists would be a better long term fix, but the
workaround will unblock further work in the short term.

Test Plan:

```
pytest test/quantization/quantize_/workflows/float8/test_float8_tensor.py -s -x
```

Reviewers:

Subscribers:

Tasks:

Tags:
ghstack-source-id: 32b5009
ghstack-comment-id: 3480842282
Pull-Request: #3279
[ghstack-poisoned]
vkuzo added a commit that referenced this pull request Nov 6, 2025
Summary:

Change the granularity for this scaling type from
`PerBlock((1, 128)), PerBlock((128, 128))` to `PerBlock([1, 128]), PerBlock([128, 128])`,
to get around the current limitation of config serialization not
supporting tuples.

Error when serializing tuples:
https://gist.github.com/vkuzo/ab4d6aec83cb98ad9417898d2c024a2c

Supporting tuples and lists would be a better long term fix, but the
workaround will unblock further work in the short term.

Test Plan:

```
pytest test/quantization/quantize_/workflows/float8/test_float8_tensor.py -s -x
```

Reviewers:

Subscribers:

Tasks:

Tags:
ghstack-source-id: 32b5009
ghstack-comment-id: 3480842282
Pull-Request: #3279
@vkuzo vkuzo changed the base branch from gh/vkuzo/161/head to main November 6, 2025 11:53
@vkuzo vkuzo merged commit a257166 into main Nov 6, 2025
19 of 28 checks passed
namgyu-youn pushed a commit to namgyu-youn/ao that referenced this pull request Nov 21, 2025
* Update

[ghstack-poisoned]

* Update

[ghstack-poisoned]

* Update

[ghstack-poisoned]

* Update

[ghstack-poisoned]

* Update

[ghstack-poisoned]

* Update

[ghstack-poisoned]

* Update

[ghstack-poisoned]

* Update

[ghstack-poisoned]

* Update

[ghstack-poisoned]

* Update

[ghstack-poisoned]

* Update

[ghstack-poisoned]

* Update

[ghstack-poisoned]

* Update

[ghstack-poisoned]

* Update

[ghstack-poisoned]

* Update

[ghstack-poisoned]

* Update

[ghstack-poisoned]

* Update

[ghstack-poisoned]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. topic: improvement Use this tag if this PR is an improvement (doesn't fit into any of the other categories)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants